package com.baidu.videoseries.adapter;

import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.TextView;

import com.baidu.videoseries.R;
import com.kvin.toolkit.adapter.BasicAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by sunmo on 2016/8/1.
 */
public class SimpleItemAdapter extends BasicAdapter<SimpleItemAdapter.ViewHolder, String> {
    public SimpleItemAdapter(final ArrayList<String> list, final Context context) {
        super(list, context);
    }





    @Override
    protected View bindView(LayoutInflater inflater, ViewGroup viewGroup, Context context, List<String> list, int i) {
        return inflater.inflate(R.layout.adapter_function,viewGroup,false);
    }

    @Override
    protected ViewHolder bindViewHolder(View view, ViewGroup viewGroup, Context context) {
        return new ViewHolder(view);
    }


    @Override
    protected void bindData(ViewHolder vh, int i, List<String> list, Context context) {
        vh.titleTv.setText(list.get(i));
    }




    static class ViewHolder extends BasicAdapter.ViewHolder{
        TextView titleTv;
        public ViewHolder(View v) {
            super(v);
            this.titleTv= (TextView) v.findViewById(R.id.title_tv);
        }
    }
}
